<?php
namespace app\api\controller;
use app\model\MotifModel;
use app\model\ScoreModel;
use app\model\TopicModel;
use think\facade\Request;

class analyze{
    //主页
    public function analyze_list(){
        session_start();
        $adminName = $_SESSION['admin_name'];
        $adminid = $_SESSION['admin_id'];
        $motif = MotifModel::where('admin_id','=',$adminid)->select();
        $motifArr = [];
        foreach($motif as $key => $value){
            $motifArr[$key][] = $value['motif_id'];
            $motifArr[$key][] = $value['motif_name'];
            $motifArr[$key][] = date('Y-m-d H:i:s',$value['add_time']);
            $motifArr[$key][] = date('Y-m-d H:i:s',$value['update_time']);
        }

            $data = [
                'status' => 0,
                'message' => '提交成功',
                'data' => [
                    'adminid'=> $adminid,
                    'motif' => $motifArr
                ]
            ];
            return json($data);


    }
    //分析
}